package com.chiancloud.shield.common.params;

import com.beust.jcommander.Parameter;
import com.chiancloud.shield.core.exception.BadCommandArgumentsException;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ComponentArgsDelegate extends AbstractArgsDelegate {


  @Parameter(names = {ARG_COMPONENT,  ARG_COMPONENT_SHORT, ARG_ROLE},
             arity = 2,
             description = "--component <name> <count>",
             splitter = DontSplitArguments.class)
  public List<String> componentTuples = new ArrayList<String>(0);


  public Map<String, String> getComponentMap() throws BadCommandArgumentsException {
    return convertTupleListToMap("component", componentTuples);
  }

  public List<String> getComponentTuples() {
    return componentTuples;
  }
}
